Advertisement
Guest User

Untitled

a guest
Jun 13th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.13 KB | None | 0 0
  1. # Generated by PNCconf at Fri Feb 22 17:48:17 2019
  2. # If you make changes to this file, they will be
  3. # overwritten when you run PNCconf again
  4.  
  5. loadrt trivkins
  6. loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  7. loadrt hostmot2
  8. loadrt hm2_pci config=" num_encoders=6 num_pwmgens=0 num_stepgens=0 sserial_port_0=102xxx"
  9. setp hm2_5i25.0.watchdog.timeout_ns 5000000
  10. loadrt pid names=pid.x,pid.y,pid.z,pid.s,pid.o
  11. loadrt scale names=scale.spindle,scale.spindle-load,scale.x-servo-load,scale.y-servo-load,scale.z-servo-load
  12. loadrt abs names=abs.spindle,abs.spindle-output
  13. loadrt lowpass names=lowpass.spindle
  14. loadrt near names=near.spindle-at-speed
  15. loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10 numBits=50 numWords=50
  16. loadrt mux16 names=jogincr,soincr
  17. loadrt mux2 names=mux2.spindle,mux2.shome
  18. loadrt tristate_bit names=tristate.orient-index
  19. loadrt orient names=orient.spindle
  20. loadrt estop_latch count=3
  21. loadrt shome names=shome.spindle
  22.  
  23. addf hm2_5i25.0.read servo-thread
  24. addf motion-command-handler servo-thread
  25. addf motion-controller servo-thread
  26. addf pid.x.do-pid-calcs servo-thread
  27. addf pid.y.do-pid-calcs servo-thread
  28. addf pid.z.do-pid-calcs servo-thread
  29. addf pid.s.do-pid-calcs servo-thread
  30. addf pid.o.do-pid-calcs servo-thread
  31. addf classicladder.0.refresh servo-thread
  32. addf jogincr servo-thread
  33. addf soincr servo-thread
  34. addf scale.spindle servo-thread
  35. addf abs.spindle servo-thread
  36. addf abs.spindle-output servo-thread
  37. addf lowpass.spindle servo-thread
  38. addf shome.spindle servo-thread
  39. addf mux2.spindle servo-thread
  40. addf mux2.shome servo-thread
  41. addf tristate.orient-index servo-thread
  42. addf orient.spindle servo-thread
  43. addf near.spindle-at-speed servo-thread
  44. addf hm2_5i25.0.write servo-thread
  45. addf estop-latch.0 servo-thread
  46. addf estop-latch.1 servo-thread
  47. addf estop-latch.2 servo-thread
  48.  
  49. # external output signals
  50.  
  51.  
  52. # --- ETS-AIR-BLAST ---
  53. net ets-clean => hm2_5i25.0.7i77.0.0.output-00
  54.  
  55. # --- TRP-PRECHARGE ---
  56. net trp-precharge => hm2_5i25.0.7i77.0.0.output-01
  57.  
  58. # --- TRP-TOOL-RELEASE ---
  59. net trp-tool-release => hm2_5i25.0.7i77.0.0.output-02
  60.  
  61. # --- SPINDLE-FAST ACCEL/DECEL ---
  62. net spindle-orient-enable => hm2_5i25.0.7i77.0.0.output-03
  63.  
  64. # --- ESTOP-OUT ---
  65. net estop-out => hm2_5i25.0.7i77.0.0.output-08
  66.  
  67. # --- LUBE-PUMP
  68. net lube-pump-on => hm2_5i25.0.7i77.0.0.output-09
  69.  
  70. # --- SPINDLE-FAN ---
  71. net spindle-enable => hm2_5i25.0.7i77.0.0.output-10
  72.  
  73. # --- AUGER-POWER
  74. net auger-on => hm2_5i25.0.7i77.0.0.output-11
  75.  
  76. # --- AUGER-REVERSE
  77. net auger-reverse => hm2_5i25.0.7i77.0.0.output-12
  78.  
  79. # --- COOLANT-FLOOD ---
  80. net coolant-flood => hm2_5i25.0.7i77.0.0.output-13
  81.  
  82. # --- SPINDLE-CW ---
  83. net spindle-cw => hm2_5i25.0.7i77.0.0.output-14
  84.  
  85. # --- SPINDLE-CCW ---
  86. net spindle-ccw => hm2_5i25.0.7i77.0.0.output-15
  87.  
  88. # external input signals
  89.  
  90. # --- SPINDLE-LOAD ---
  91. net spindle_load <= hm2_5i25.0.7i77.0.0.analogin0
  92.  
  93. # --- X AXIS SERVO LOAD ---
  94. net x-axis-load-raw <= hm2_5i25.0.7i77.0.0.analogin1
  95.  
  96. # --- Y AXIS SERVO LOAD ---
  97. net y-axis-load-raw <= hm2_5i25.0.7i77.0.0.analogin2
  98.  
  99. # --- Z AXIS SERVO LOAD ---
  100. net z-axis-load-raw <= hm2_5i25.0.7i77.0.0.analogin3
  101.  
  102. # --- CONSOLE ESTOP SWITCH ---
  103. net console-estop <= hm2_5i25.0.7i77.0.0.input-04-not
  104. net latch0-ok-in <= hm2_5i25.0.7i77.0.0.input-04
  105.  
  106. # --- PROBE-IN ---
  107. net probe-in <= hm2_5i25.0.7i77.0.0.input-05
  108.  
  109. # --- EST OT ESTOP SWITCH ---
  110. net ets-estop <= hm2_5i25.0.7i77.0.0.input-06-not
  111.  
  112. # --- LUBE-OIL-LOW ---
  113. net LowLubeSw <= hm2_5i25.0.7i77.0.0.input-07
  114. net low-oil <= hm2_5i25.0.7i77.0.0.input-07-not
  115.  
  116. # --- CABINET ESTOP SWITCH ---
  117. net cabinet-estop <= hm2_5i25.0.7i77.0.0.input-08
  118.  
  119. # --- X-AMP-FAULT-STATUS ---
  120. net x-fault-status <= hm2_5i25.0.7i77.0.0.input-17
  121.  
  122. # --- Y-AMP-FAULT-STATUS ---
  123. net y-fault-status <= hm2_5i25.0.7i77.0.0.input-19
  124.  
  125. # --- Z-AMP-FAULT-STATUS ---
  126. net z-fault-status <= hm2_5i25.0.7i77.0.0.input-21
  127.  
  128. # --- AIR-PRESSURE-SWITCH ---
  129. net air-pressure-switch <= hm2_5i25.0.7i77.0.0.input-24
  130.  
  131. # --- AUGER-CURRENT-LIMIT ---
  132. net auger-current-switch <= hm2_5i25.0.7i77.0.0.input-26
  133.  
  134. # --- TRP-OPEN ---
  135. net trp-open <= hm2_5i25.0.7i77.0.0.input-27-not
  136.  
  137. # --- MAX-HOME-Z ---
  138. net max-home-z <= hm2_5i25.0.7i77.0.0.input-28-not
  139.  
  140. # --- MAX-HOME-Y ---
  141. net max-home-y <= hm2_5i25.0.7i77.0.0.input-29-not
  142.  
  143. # --- MAX-HOME-X ---
  144. net max-home-x <= hm2_5i25.0.7i77.0.0.input-30-not
  145.  
  146. # --- SPINDLE-FAULT ---
  147. net spindle-fault <= hm2_5i25.0.7i77.0.0.input-31-not
  148.  
  149. # --- JOG-INCR-C ---
  150. net jog-incr-c <= hm2_5i25.0.7i84.0.2.input-08
  151.  
  152. # --- JOG-INCR-B ---
  153. net jog-incr-b <= hm2_5i25.0.7i84.0.2.input-09
  154.  
  155. # --- JOG-INCR-A ---
  156. net jog-incr-a <= hm2_5i25.0.7i84.0.2.input-10
  157.  
  158. # --- ZERO-X-BUTTON ---
  159. net zero-x-button <= hm2_5i25.0.7i84.0.2.input-11
  160. net zero-x-button => halui.mdi-command-00
  161.  
  162. # --- ZERO-Y-BUTTON ---
  163. net zero-y-button <= hm2_5i25.0.7i84.0.2.input-12
  164. net zero-y-button => halui.mdi-command-01
  165.  
  166. # --- ZERO-Z-BUTTON ---
  167. net zero-z-button <= hm2_5i25.0.7i84.0.2.input-13
  168. net zero-z-button => halui.mdi-command-02
  169.  
  170. # --- CONSOLE-ESTOP-RESET ---
  171. net latch-reset <= hm2_5i25.0.7i84.0.2.input-18
  172.  
  173. # --- HOME-ALL ---
  174. net home-all <= hm2_5i25.0.7i84.0.2.input-20
  175.  
  176. # --- CYCLE-START ---
  177. net cycle-start <= hm2_5i25.0.7i84.0.2.input-21
  178.  
  179. # --- ABORT ---
  180. net abort <= hm2_5i25.0.7i84.0.2.input-22
  181.  
  182. # --- TRP-RELEASE ---
  183. net trp-release <= hm2_5i25.0.7i84.0.2.input-23
  184.  
  185. # --- FEED-HOLD ---
  186. net feed-hold <= hm2_5i25.0.7i84.0.2.input-24
  187.  
  188. # --- JOINT-SELECT-A ---
  189. net joint-select-a <= hm2_5i25.0.7i84.0.2.input-28
  190.  
  191. # --- JOINT-SELECT-B ---
  192. net joint-select-b <= hm2_5i25.0.7i84.0.2.input-29
  193.  
  194. # --- JOINT-SELECT-C ---
  195. net joint-select-c <= hm2_5i25.0.7i84.0.2.input-30
  196.  
  197. # --- JOINT-SELECT-D ---
  198. net joint-select-d <= hm2_5i25.0.7i84.0.2.input-31
  199.  
  200. #*******************
  201. # AXIS X
  202. #*******************
  203.  
  204. setp pid.x.Pgain [AXIS_0]P
  205. setp pid.x.Igain [AXIS_0]I
  206. setp pid.x.Dgain [AXIS_0]D
  207. setp pid.x.bias [AXIS_0]BIAS
  208. setp pid.x.FF0 [AXIS_0]FF0
  209. setp pid.x.FF1 [AXIS_0]FF1
  210. setp pid.x.FF2 [AXIS_0]FF2
  211. setp pid.x.deadband [AXIS_0]DEADBAND
  212. setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT
  213. setp pid.x.error-previous-target true
  214.  
  215. net x-index-enable <=> pid.x.index-enable
  216. net x-enable => pid.x.enable
  217. net x-pos-cmd => pid.x.command
  218. net x-vel-cmd => pid.x.command-deriv
  219. net x-pos-fb => pid.x.feedback
  220. net x-output => pid.x.output
  221.  
  222. # ---PWM Generator signals/setup---
  223.  
  224. setp hm2_5i25.0.7i77.0.1.analogout0-scalemax [AXIS_0]OUTPUT_SCALE
  225. setp hm2_5i25.0.7i77.0.1.analogout0-minlim [AXIS_0]OUTPUT_MIN_LIMIT
  226. setp hm2_5i25.0.7i77.0.1.analogout0-maxlim [AXIS_0]OUTPUT_MAX_LIMIT
  227.  
  228. net x-output => hm2_5i25.0.7i77.0.1.analogout0
  229. net x-pos-cmd axis.0.motor-pos-cmd
  230. net x-enable axis.0.amp-enable-out
  231. # enable _all_ sserial pwmgens
  232. net x-enable hm2_5i25.0.7i77.0.1.analogena
  233.  
  234. # ---Encoder feedback signals/setup---
  235.  
  236. setp hm2_5i25.0.encoder.00.counter-mode 0
  237. setp hm2_5i25.0.encoder.00.filter 1
  238. setp hm2_5i25.0.encoder.00.index-invert 0
  239. setp hm2_5i25.0.encoder.00.index-mask 0
  240. setp hm2_5i25.0.encoder.00.index-mask-invert 0
  241. setp hm2_5i25.0.encoder.00.scale [AXIS_0]ENCODER_SCALE
  242.  
  243. net x-pos-fb <= hm2_5i25.0.encoder.00.position
  244. net x-vel-fb <= hm2_5i25.0.encoder.00.velocity
  245. net x-pos-fb => axis.0.motor-pos-fb
  246. net x-index-enable axis.0.index-enable <=> hm2_5i25.0.encoder.00.index-enable
  247. net x-pos-rawcounts <= hm2_5i25.0.encoder.00.rawcounts
  248.  
  249. # ---setup home / limit switch signals---
  250.  
  251. net max-home-x => axis.0.home-sw-in
  252. net x-neg-limit => axis.0.neg-lim-sw-in
  253. net max-home-x => axis.0.pos-lim-sw-in
  254.  
  255. #*******************
  256. # AXIS Y
  257. #*******************
  258.  
  259. setp pid.y.Pgain [AXIS_1]P
  260. setp pid.y.Igain [AXIS_1]I
  261. setp pid.y.Dgain [AXIS_1]D
  262. setp pid.y.bias [AXIS_1]BIAS
  263. setp pid.y.FF0 [AXIS_1]FF0
  264. setp pid.y.FF1 [AXIS_1]FF1
  265. setp pid.y.FF2 [AXIS_1]FF2
  266. setp pid.y.deadband [AXIS_1]DEADBAND
  267. setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
  268. setp pid.y.error-previous-target true
  269.  
  270. net y-index-enable <=> pid.y.index-enable
  271. net y-enable => pid.y.enable
  272. net y-pos-cmd => pid.y.command
  273. net y-vel-cmd => pid.y.command-deriv
  274. net y-pos-fb => pid.y.feedback
  275. net y-output => pid.y.output
  276.  
  277. # ---PWM Generator signals/setup---
  278.  
  279. setp hm2_5i25.0.7i77.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
  280. setp hm2_5i25.0.7i77.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
  281. setp hm2_5i25.0.7i77.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT
  282.  
  283. net y-output => hm2_5i25.0.7i77.0.1.analogout1
  284. net y-pos-cmd axis.1.motor-pos-cmd
  285. net y-enable axis.1.amp-enable-out
  286.  
  287. # ---Encoder feedback signals/setup---
  288.  
  289. setp hm2_5i25.0.encoder.01.counter-mode 0
  290. setp hm2_5i25.0.encoder.01.filter 1
  291. setp hm2_5i25.0.encoder.01.index-invert 0
  292. setp hm2_5i25.0.encoder.01.index-mask 0
  293. setp hm2_5i25.0.encoder.01.index-mask-invert 0
  294. setp hm2_5i25.0.encoder.01.scale [AXIS_1]ENCODER_SCALE
  295.  
  296. net y-pos-fb <= hm2_5i25.0.encoder.01.position
  297. net y-vel-fb <= hm2_5i25.0.encoder.01.velocity
  298. net y-pos-fb => axis.1.motor-pos-fb
  299. net y-index-enable axis.1.index-enable <=> hm2_5i25.0.encoder.01.index-enable
  300. net y-pos-rawcounts <= hm2_5i25.0.encoder.01.rawcounts
  301.  
  302. # ---setup home / limit switch signals---
  303.  
  304. net max-home-y => axis.1.home-sw-in
  305. net y-neg-limit => axis.1.neg-lim-sw-in
  306. net max-home-y => axis.1.pos-lim-sw-in
  307.  
  308. #*******************
  309. # AXIS Z
  310. #*******************
  311.  
  312. setp pid.z.Pgain [AXIS_2]P
  313. setp pid.z.Igain [AXIS_2]I
  314. setp pid.z.Dgain [AXIS_2]D
  315. setp pid.z.bias [AXIS_2]BIAS
  316. setp pid.z.FF0 [AXIS_2]FF0
  317. setp pid.z.FF1 [AXIS_2]FF1
  318. setp pid.z.FF2 [AXIS_2]FF2
  319. setp pid.z.deadband [AXIS_2]DEADBAND
  320. setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
  321. setp pid.z.error-previous-target true
  322.  
  323. net z-index-enable <=> pid.z.index-enable
  324. net z-enable => pid.z.enable
  325. net z-pos-cmd => pid.z.command
  326. net z-vel-cmd => pid.z.command-deriv
  327. net z-pos-fb => pid.z.feedback
  328. net z-output => pid.z.output
  329.  
  330. # ---PWM Generator signals/setup---
  331.  
  332. setp hm2_5i25.0.7i77.0.1.analogout2-scalemax [AXIS_2]OUTPUT_SCALE
  333. setp hm2_5i25.0.7i77.0.1.analogout2-minlim [AXIS_2]OUTPUT_MIN_LIMIT
  334. setp hm2_5i25.0.7i77.0.1.analogout2-maxlim [AXIS_2]OUTPUT_MAX_LIMIT
  335.  
  336. net z-output => hm2_5i25.0.7i77.0.1.analogout2
  337. net z-pos-cmd axis.2.motor-pos-cmd
  338. net z-enable axis.2.amp-enable-out
  339.  
  340. # ---Encoder feedback signals/setup---
  341.  
  342. setp hm2_5i25.0.encoder.02.counter-mode 0
  343. setp hm2_5i25.0.encoder.02.filter 1
  344. setp hm2_5i25.0.encoder.02.index-invert 0
  345. setp hm2_5i25.0.encoder.02.index-mask 0
  346. setp hm2_5i25.0.encoder.02.index-mask-invert 0
  347. setp hm2_5i25.0.encoder.02.scale [AXIS_2]ENCODER_SCALE
  348.  
  349. net z-pos-fb <= hm2_5i25.0.encoder.02.position
  350. net z-vel-fb <= hm2_5i25.0.encoder.02.velocity
  351. net z-pos-fb => axis.2.motor-pos-fb
  352. net z-index-enable axis.2.index-enable <=> hm2_5i25.0.encoder.02.index-enable
  353. net z-pos-rawcounts <= hm2_5i25.0.encoder.02.rawcounts
  354.  
  355. # ---setup home / limit switch signals---
  356.  
  357. net max-home-z => axis.2.home-sw-in
  358. net z-neg-limit => axis.2.neg-lim-sw-in
  359. net max-home-z => axis.2.pos-lim-sw-in
  360.  
  361. #*******************
  362. # SPINDLE S
  363. #*******************
  364.  
  365. # Velocity Tuning
  366. setp pid.s.Pgain [JOINT_3]P
  367. setp pid.s.Igain [JOINT_3]I
  368. setp pid.s.Dgain [JOINT_3]D
  369. setp pid.s.bias [JOINT_3]BIAS
  370. setp pid.s.FF0 [JOINT_3]FF0
  371. setp pid.s.FF1 [JOINT_3]FF1
  372. setp pid.s.FF2 [JOINT_3]FF2
  373. setp pid.s.deadband [JOINT_3]DEADBAND
  374. setp pid.s.maxoutput [JOINT_3]MAX_OUTPUT
  375. setp pid.s.error-previous-target true
  376.  
  377. net spindle-index-enable <=> pid.s.index-enable
  378. net spindle-enable => pid.s.enable
  379. net spindle-vel-cmd-rpm => pid.s.command
  380. net spindle-fb-rpm => pid.s.feedback
  381. net spindle-s-output <= pid.s.output
  382.  
  383. # Position Tuning
  384. setp pid.o.Pgain [JOINT_4]P
  385. setp pid.o.Igain [JOINT_4]I
  386. setp pid.o.Dgain [JOINT_4]D
  387. setp pid.o.bias [JOINT_4]BIAS
  388. setp pid.o.FF0 [JOINT_4]FF0
  389. setp pid.o.FF1 [JOINT_4]FF1
  390. setp pid.o.FF2 [JOINT_4]FF2
  391. setp pid.o.deadband [JOINT_4]DEADBAND
  392. setp pid.o.maxoutput [JOINT_4]MAX_OUTPUT
  393. setp pid.o.error-previous-target true
  394.  
  395. net spindle-index-enable <=> pid.o.index-enable
  396. net spindle-orient-enable => pid.o.enable
  397. net orient-command => pid.o.command
  398. net spindle-revs => pid.o.feedback
  399. net spindle-o-output <= pid.o.output
  400.  
  401. # ---PWM Generator signals/setup---
  402.  
  403. setp hm2_5i25.0.7i77.0.1.analogout5-scalemax [JOINT_3]OUTPUT_SCALE
  404. setp hm2_5i25.0.7i77.0.1.analogout5-minlim [JOINT_3]OUTPUT_MIN_LIMIT
  405. setp hm2_5i25.0.7i77.0.1.analogout5-maxlim [JOINT_3]OUTPUT_MAX_LIMIT
  406.  
  407. net spindle-output => hm2_5i25.0.7i77.0.1.analogout5
  408. net machine-is-enabled => hm2_5i25.0.7i77.0.1.spinena
  409.  
  410. # ---Encoder feedback signals/setup---
  411.  
  412. setp hm2_5i25.0.encoder.05.counter-mode 0
  413. setp hm2_5i25.0.encoder.05.filter 1
  414. setp hm2_5i25.0.encoder.05.index-invert 0
  415. setp hm2_5i25.0.encoder.05.index-mask 0
  416. setp hm2_5i25.0.encoder.05.index-mask-invert 0
  417. setp hm2_5i25.0.encoder.05.scale [JOINT_3]ENCODER_SCALE
  418.  
  419. net spindle-revs <= hm2_5i25.0.encoder.05.position
  420. net spindle-vel-fb-rps <= hm2_5i25.0.encoder.05.velocity
  421. net spindle-index-enable <=> hm2_5i25.0.encoder.05.index-enable
  422.  
  423. # ---setup spindle control signals---
  424.  
  425. net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
  426. net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
  427. net spindle-vel-cmd-rpm <= motion.spindle-speed-out
  428. net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
  429. net spindle-enable <= motion.spindle-on
  430. #net spindle-cw <= motion.spindle-forward
  431. #net spindle-ccw spindle-orient-enable<= motion.spindle-reverse
  432. net spindle-brake <= motion.spindle-brake
  433. net spindle-revs => motion.spindle-revs
  434. net spindle-at-speed => motion.spindle-at-speed
  435. net spindle-vel-fb-rps => motion.spindle-speed-in
  436. net spindle-index-enable <=> motion.spindle-index-enable
  437. net spindle-fault => axis.2.amp-fault-in
  438.  
  439. # ---Setup spindle orient componant---
  440.  
  441. net spindle-orient-enable <= motion.spindle-orient
  442. net spindle-orient-angle <= motion.spindle-orient-angle
  443. net spindle-orient-mode => motion.spindle-orient-mode
  444.  
  445. net spindle-orient-enable => orient.spindle.enable
  446. net spindle-orient-angle => orient.spindle.angle
  447. net spindle-orient-mode => orient.spindle.mode
  448. net spindle-revs => orient.spindle.position
  449. net spindle-orient-poserror <= orient.spindle.poserr
  450. net orient-command <= orient.spindle.command
  451. net spindle-oriented <= orient.spindle.is-oriented
  452. net spindle-oriented => motion.spindle-is-oriented
  453.  
  454. # ---Setup mux2.spindle to switch between pid outputs---
  455.  
  456. net spindle-s-output => mux2.spindle.in0
  457. net spindle-o-output => mux2.spindle.in1
  458. net spindle-orient-enable => mux2.spindle.sel
  459. net pid-mux-command <= mux2.spindle.out
  460.  
  461. # ---Setup mux2.shome to home spindle---
  462.  
  463. net pid-mux-command => mux2.shome.in0
  464. net spindle-shome-command => mux2.shome.in1
  465. net spindle-en-homing => mux2.shome.sel
  466. net spindle-command <= mux2.shome.out
  467.  
  468. # ---Setup ABS component to drive vfd---
  469.  
  470. net spindle-command => abs.spindle-output.in
  471. #net pid-mux-command => abs.spindle-output.in
  472. net spindle-output <= abs.spindle-output.out
  473. net spindle-cw <= abs.spindle-output.is-positive
  474. net spindle-ccw <= abs.spindle-output.is-negative
  475.  
  476. # ---Setup TRISTATE component to index-enable encoder---
  477.  
  478. #net spindle-orient-enable => tristate.orient-index.in
  479. #net spindle-index-enable <= tristate.orient-index.out
  480. #net spindle-orient-enable => tristate.orient-index.enable
  481.  
  482. # ---Setup spindle at speed signals---
  483.  
  484. net spindle-vel-cmd-rps => near.spindle-at-speed.in1
  485. net spindle-vel-fb-rps => near.spindle-at-speed.in2
  486. net spindle-at-speed <= near.spindle-at-speed.out
  487. setp near.spindle-at-speed.scale 1.000000
  488. setp near.spindle-at-speed.difference 1.00000
  489.  
  490. # Use ACTUAL spindle velocity from spindle encoder
  491. # spindle-velocity bounces around so we filter it with lowpass
  492. # spindle-velocity is signed so we use absolute component to remove sign
  493. # ACTUAL velocity is in RPS not RPM so we scale it.
  494.  
  495. setp scale.spindle.gain 60
  496. setp lowpass.spindle.gain 1.000000
  497. net spindle-vel-fb-rps => scale.spindle.in
  498. net spindle-fb-rpm scale.spindle.out => abs.spindle.in
  499. net spindle-fb-rpm-abs abs.spindle.out => lowpass.spindle.in
  500. net spindle-fb-rpm-abs-filtered lowpass.spindle.out
  501.  
  502. # --- Home Spindle when Z homes
  503.  
  504. net z-is-homed => shome.spindle.enable
  505. net spindle-shome-command <= shome.spindle.command
  506. net spindle-en-homing <= shome.spindle.homing
  507. net spindle-homed => shome.spindle.homed
  508. net spindle-index-enable <=> shome.spindle.index-enable
  509. setp shome.spindle.velocity 100
  510.  
  511.  
  512. #******************************
  513. # connect miscellaneous signals
  514. #******************************
  515.  
  516. # ---HALUI signals---
  517.  
  518. net joint-select-a halui.joint.0.select
  519. net x-is-homed halui.joint.0.is-homed
  520. net jog-x-pos halui.jog.0.plus
  521. net jog-x-neg halui.jog.0.minus
  522. net jog-x-analog halui.jog.0.analog
  523. net joint-select-b halui.joint.1.select
  524. net y-is-homed halui.joint.1.is-homed
  525. net jog-y-pos halui.jog.1.plus
  526. net jog-y-neg halui.jog.1.minus
  527. net jog-y-analog halui.jog.1.analog
  528. net joint-select-c halui.joint.2.select
  529. net z-is-homed halui.joint.2.is-homed
  530. net jog-z-pos halui.jog.2.plus
  531. net jog-z-neg halui.jog.2.minus
  532. net jog-z-analog halui.jog.2.analog
  533. net jog-selected-pos halui.jog.selected.plus
  534. net jog-selected-neg halui.jog.selected.minus
  535. net spindle-manual-cw halui.spindle.forward
  536. net spindle-manual-ccw halui.spindle.reverse
  537. net spindle-manual-stop halui.spindle.stop
  538. net machine-is-on halui.machine.is-on
  539. net jog-speed halui.jog-speed
  540. net MDI-mode halui.mode.is-mdi
  541. net cycle-start halui.program.run
  542. net abort halui.program.stop
  543. net home-all halui.home-all
  544. net feed-hold halui.program.pause
  545. net estop-activated halui.estop.is-activated
  546.  
  547. # ---coolant signals---
  548.  
  549. net coolant-mist <= iocontrol.0.coolant-mist
  550. net coolant-flood <= iocontrol.0.coolant-flood
  551.  
  552. # ---probe signal---
  553.  
  554. net probe-in => motion.probe-input
  555.  
  556. # ---jogwheel signals to mesa encoder - shared MPG---
  557.  
  558. net joint-selected-count <= hm2_5i25.0.7i84.0.2.enc0.count
  559.  
  560. # ---mpg signals---
  561.  
  562. # for axis x MPG
  563. setp axis.0.jog-vel-mode 0
  564. net selected-jog-incr => axis.0.jog-scale
  565. net joint-select-a => axis.0.jog-enable
  566. net joint-selected-count => axis.0.jog-counts
  567.  
  568. # for axis y MPG
  569. setp axis.1.jog-vel-mode 0
  570. net selected-jog-incr => axis.1.jog-scale
  571. net joint-select-b => axis.1.jog-enable
  572. net joint-selected-count => axis.1.jog-counts
  573.  
  574. # for axis z MPG
  575. setp axis.2.jog-vel-mode 0
  576. net selected-jog-incr => axis.2.jog-scale
  577. net joint-select-c => axis.2.jog-enable
  578. net joint-selected-count => axis.2.jog-counts
  579.  
  580.  
  581. # connect selectable mpg jog increments
  582.  
  583. net jog-incr-a => jogincr.sel0
  584. net jog-incr-b => jogincr.sel1
  585. net jog-incr-c => jogincr.sel2
  586. net jog-incr-d => jogincr.sel3
  587. net selected-jog-incr <= jogincr.out-f
  588. setp jogincr.debounce-time 0.200000
  589. setp jogincr.use-graycode False
  590. setp jogincr.suppress-no-input False
  591. setp jogincr.in00 0.000000
  592. setp jogincr.in01 0.000100
  593. setp jogincr.in02 0.001000
  594. setp jogincr.in03 0.001000
  595. setp jogincr.in04 0.010000
  596. setp jogincr.in05 0.010000
  597. setp jogincr.in06 0.050000
  598. setp jogincr.in07 0.100000
  599. setp jogincr.in08 0.125000
  600. setp jogincr.in09 0.125000
  601. setp jogincr.in10 0.125000
  602. setp jogincr.in11 0.125000
  603. setp jogincr.in12 0.125000
  604. setp jogincr.in13 0.125000
  605. setp jogincr.in14 0.125000
  606. setp jogincr.in15 0.125000
  607.  
  608. # connect spindle overide increments - MPG
  609.  
  610. setp halui.spindle-override.direct-value false
  611. setp halui.spindle-override.scale .01
  612. net so-enable => halui.spindle-override.count-enable
  613. net joint-selected-count => halui.spindle-override.counts
  614.  
  615. # ---motion control signals---
  616.  
  617. net in-position <= motion.in-position
  618. net machine-is-enabled <= motion.motion-enabled
  619.  
  620. # ---digital in / out signals---
  621.  
  622. net ets-clean <= motion.digital-out-00
  623.  
  624. # ---estop signals---
  625.  
  626. net latch0-ok-in => estop-latch.0.ok-in
  627. net latch0-out <= estop-latch.0.ok-out
  628. net latch0-out => estop-latch.1.ok-in
  629. net latch1-out <= estop-latch.1.ok-out
  630. net latch1-out => estop-latch.2.ok-in
  631.  
  632. net latch-reset => estop-latch.0.reset
  633. net latch-reset => estop-latch.1.reset
  634. net latch-reset => estop-latch.2.reset
  635.  
  636. net estop-out iocontrol.0.emc-enable-in <= estop-latch.2.ok-out
  637.  
  638. net console-estop => estop-latch.0.fault-in
  639. net cabinet-estop => estop-latch.1.fault-in
  640. net ets-estop => estop-latch.2.fault-in
  641.  
  642. # ---manual tool change signals---
  643.  
  644. loadusr -W hal_manualtoolchange
  645. net tool-change-request iocontrol.0.tool-change => hal_manualtoolchange.change
  646. net tool-change-confirmed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
  647. net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
  648. net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
  649.  
  650. # ---Classic Ladder Code ---
  651.  
  652. # Load Classicladder without GUI (can reload LADDER GUI in AXIS GUI
  653.  
  654. loadusr classicladder --nogui trp_ladder.clp
  655.  
  656. net trp-release => classicladder.0.in-00
  657. net spindle-enable => classicladder.0.in-01
  658. net estop-activated => classicladder.0.in-02
  659. net spindle-orient-enable => classicladder.0.in-03
  660.  
  661. net trp-precharge <= classicladder.0.out-00
  662. net trp-tool-release <= classicladder.0.out-01
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement